package com.testing.sunnycommon.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

/**
 * @Classname SunnyUser
 * @Description 类型说明
 * @Date 2023/6/28 21:47
 * @Created by 特斯汀Roy
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SunnyUser implements UserDetails {
    private Long id;
    private String username;
    private String password;
    private String gender;
    private String dept;
    private String nickname;
    private String avatar;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    //这几个数据方法全部是security中的userDetails所需要的字段但我们不做设计
    //为了让账号能够正常使用，全部用true
    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
